#include<stdio.h>

int find(int(*arr)[3],int* px,int* py,int k)
{
	int x=0,y=*py-1;
	while(x<*px&&y>=0)
	{
		if(k>arr[x][y])
			x++;
		else if(k<arr[x][y])
			y--;
		else
		{
			*px=x,*py=y;
			return 1;
		}
	}
	return 0;
}

int main()
{
	int arr[3][3]={1,2,3,4,5,6,7,8,9};
	int k=0;
	scanf("%d",&k);
	int x=3,y=3;
	if(find(arr,&x,&y,k))
		printf("%d %d\n",x,y);
	else
		printf("no\n");
	return 0;
}
